package com.zzyl.nursing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.domain.FamilyMemberElder;
import com.zzyl.nursing.vo.DeviceDataPointVo;
import com.zzyl.nursing.vo.FamilyMemberElderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 家属与老人关联Mapper接口
 * 
 * @author ruoyi
 * @date 2025-10-29
 */
@Mapper
public interface FamilyMemberElderMapper extends BaseMapper<FamilyMemberElder>
{
    /**
     * 查询家属与老人关联
     * 
     * @param id 家属与老人关联主键
     * @return 家属与老人关联
     */
    public FamilyMemberElder selectFamilyMemberElderById(Long id);

    /**
     * 查询家属与老人关联列表
     * 
     * @param familyMemberElder 家属与老人关联
     * @return 家属与老人关联集合
     */
    public List<FamilyMemberElder> selectFamilyMemberElderList(FamilyMemberElder familyMemberElder);

    /**
     * 新增家属与老人关联
     * 
     * @param familyMemberElder 家属与老人关联
     * @return 结果
     */
    public int insertFamilyMemberElder(FamilyMemberElder familyMemberElder);

    /**
     * 修改家属与老人关联
     * 
     * @param familyMemberElder 家属与老人关联
     * @return 结果
     */
    public int updateFamilyMemberElder(FamilyMemberElder familyMemberElder);

    /**
     * 删除家属与老人关联
     * 
     * @param id 家属与老人关联主键
     * @return 结果
     */
    public int deleteFamilyMemberElderById(Long id);

    /**
     * 批量删除家属与老人关联
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFamilyMemberElderByIds(Long[] ids);

    List<FamilyMemberElderVo> listByPage(Long userId);


    List<DeviceDataPointVo> queryDeviceDataListByDay(
            @Param("functionId") String functionId,
            @Param("iotId") String iotId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime
    );

    List<DeviceDataPointVo> queryDeviceDataListByWeek(@Param("functionId") String functionId,
                                                      @Param("iotId") String iotId,
                                                      @Param("startTime") LocalDateTime startTime,
                                                      @Param("endTime") LocalDateTime endTime);

}
